<html>
<head>
<link href="../../../Objects/sofa_white.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<div id="contenu">
		
		<center><h3>Topological Mapping (4/7)</h3></center>		  		 
		 <center><img src="mappingTriangle_01.png" width="300" name="TopologyTetra2TriangleTopologicalMapping" align="middle">
		</center>

		<br><div id="orangeText">Description</div>
        
		<p> Here is the important step of this tutorial. We add a child node containing the triangular topology which is directly linked to the tetrahedral mesh thanks to the topological mapping component. This will allow us to display a visual model.</p>
        
		<div id="orangeText">Key points</div>

		<p>In this step, we add a number of components that will contribute to the visual model.</p>
        <p>
        <ul>
		  <li>Dynamic topological components to store the surface mesh. </li>
		  <li><b>Tetra2TriangleTopologicalMapping</b> component is used to map triangles on the border of the tetrahedral mesh to the surface topological container. </li>
		  <li>Then, <b>OglModel</b> can be used to visualize the surface mesh.</li>
		</ul>
        </p>


      
        <div id="tutorialAction"><p>Add a new <strong>GNode</strong> to the <strong>Tetrahedrons Mesh</strong> node. Rename it "Triangles Mesh".</p>
        
        <p>Add the following components to the <strong>Triangles Mesh</strong> node, giving them appropriate names:</p>
        
        <p>
        <ul>
        	<li><strong>TriangleSetTopologyContainer</strong> named "Container"</li>
          <li><strong>TriangleSetTopoologyModifier</strong> named "Modifier"</li>
          <li><strong>TriangleSetGeometryAlgorithms</strong> named "GeomAlgo"</li>
          <li><strong>Tetra2TriangleTopologicalMapping</strong> named "Mapping"</li>
      	</ul>
        </p>

        <p> The <strong>TriangleSetTopoologyModifier</strong> is a component which can manipulate an
associated <strong>TriangleSetTopologyContainer</strong>. There is therefore a clean separation between the container, which allocates and store the memory, and the algorithms which can manipulate this data. </p>  
        
        <p>In the <strong>Mapping</strong> properties, change the <strong>Input topology to map</strong> to "@../Container", and change the <strong>Output topology to map</strong> to @Container.</p></div>
        
        <p>This tells the mapping to convert the <strong>tetrahedron</strong> topology to a <strong>triangle</strong> topology.</p>
        
        <div id="tutorialAction"><p>Add a new <strong>GNode</strong> to the <strong>Triangles Mesh</strong> node, and rename it "Visu".</p>
        
        <p>Add an <strong>OglModel</strong> component to the <strong>Visu</strong> node. Rename it "Visual".</p>
        
        <p>Find the <strong>IdentityMapping</strong> component using the <strong>Filter</strong>. In the dropdown menu on the right, select <strong>Vec3d, ExtVec3f</strong>, and add it to the <strong>Visu</strong> node.</p>
        <p>In the <strong>Property 2/2</strong> tab, change the <strong>Input object to map</strong> to "@../../Volume" and the <strong>Output object to map</strong> to "@Visual".</p></div>

		<div id="orangeText">Results</div>
		
        <div id="tutorialAction"><p>Run in SOFA and animate.</p></div>
        
        <p> In this step the mechanical behavior stays the same. But a visual model can now be used to display the surface of the object.</p>
		
		<center><img src="mappingTriangle_02.png" width="300" name="TopologyTetra2TriangleTopologicalMapping" align="middle">

                <br><center><h3><a href="2_TopoMapping.scn">Previous</a> ____________ <a href="4_TopoMapping.scn">Next</a></center></h3>
	</div>
</body>
</html>
